Skip to content

[deno] Rework error and device loss handling #7693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2025

Conversation

andyleiserson
Copy link
Contributor

The goal of these changes is to make the CTS work again under deno, see #6838 and #7675.

There are two things happening here:

  1. As was already noted by a TODO, reading device.lost should always return the same promise.
  2. Handling errors in an async task without coordinating with the v8 runtime seemed to make things unhappy. I'm not sure exactly why -- the process was exiting silently. With this change, deno's V8TaskSpawner is used to schedule error handling through the runtime.

Testing
Tested using the webgpu:api,operation,device,lost:* and webgpu:api,operation,uncapturederror:* CTS tests. However, additional changes are needed to get the CTS to work, so until the rest of those changes are made, there isn't a mechanism to test this in the wgpu tree (that I'm aware of).

Squash or Rebase? Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@andyleiserson andyleiserson requested review from crowlKats and a team as code owners May 14, 2025 20:15
Copy link
Contributor

@littledivy littledivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cc @crowlKats

Copy link
Collaborator

@crowlKats crowlKats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with v8TaskSpawner, but if Divy says it's all good, then LGTM!

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skimmed it only but if @crowlKats says it's all good then lgtm 😄

@Wumpf Wumpf merged commit 26bab56 into gfx-rs:trunk May 17, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants